<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="itcast" uri="http://itcast.cn/common/"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>员工信息详情</title>
<!-- Bootstrap Core CSS -->
<link href="<%=basePath%>css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- 导航 -->
    <nav class="navbar navbar-default ">
      <div class="container">
        <!-- 小屏幕按钮和logo -->
        <div class="navbar-header">
          <button class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a href="#" class="navbar-brand">RM admin</a>
        </div>
        <!-- 小屏幕按钮和logo -->
        <!-- 导航 -->
        <div class="collapse navbar-collapse">
           <ul class=" nav navbar-nav ">
             <li class="active"><a href="#"><span class="glyphicon glyphicon-home"></span> &nbsp;后台首页</a></li>
             <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    组织结构管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/organization/department">部门管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/organization/job">岗位管理</a></li>

                </ul>
            </li>
            <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    人事信息管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/employee/enterAddEmployee">员工入职管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/period/enterPeriod/">试用期管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/dept/out">部门调动管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/post/out">岗位调动管理</a></li>
                    <li><a href="${pageContext.request.contextPath }/leave/out">员工离职管理</a></li>

                </ul>
            </li>
             <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    员工信息中心
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/infoemployee/list">员工信息中心</a></li>


                </ul>
            </li>
            <li class="dropdown">
                <a href="organization.html" class="dropdown-toggle" data-toggle="dropdown">
                    报表管理
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a href="${pageContext.request.contextPath }/statement/newHire">新聘员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/departure">离职员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/deptTurn">部门调动员工报表</a></li>
                    <li><a href="${pageContext.request.contextPath }/statement/postTurn">岗位调动员工报表</a></li>
                </ul>
            </li>
           </ul>
           <ul class=" nav navbar-nav navbar-right ">
             <li class="dropdown">
                <a href="#" class=" dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown">admin
                    <span class="caret"></span>
                </a>
            </li>

             <li><a href="http://localhost:8080/PMsystem/admin/exit"><span class="glyphicon glyphicon-off"></span>&nbsp;退出</a></li>
           </ul>
        </div>
        <!-- 导航 -->
      </div>
    </nav>
   <!-- 导航 -->
   <div class="container-fluid">
       <div class="row">
           <div class="col-md-2">
               <div class="panel-group" id="accordion">
                   <div class="panel panel-info">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThree" style="text-decoration: none;">
                            职业生涯信息维护
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThree" class="panel-collapse collapse in">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/content/addCareer.action?car_emp_id=${empId}"  style="text-decoration: none;">新增职业生涯信息</a></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>

                  <div class="panel panel-info">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThreeo" style="text-decoration: none;">
                            外语能力信息维护
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThreeo" class="panel-collapse collapse ">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/content/addLanguage.action?lan_emp_id=${empId}"  style="text-decoration: none;">新增外语能力信息</a></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>

                  <div class="panel panel-info">
                      <div class="panel-heading">
                          <h4 class="panel-title">
                              <a data-toggle="collapse" data-parent="#accordion"
                              href="#collapseThreeot" style="text-decoration: none;">
                            家庭成员及社会关系
                              </a>
                          </h4>
                      </div>
                      <div id="collapseThreeot" class="panel-collapse collapse ">
                          <div class="panel-body">
                              <table class="table table-hover">
                              <tbody>
                                <tr>
                                  <td style="border:none;"><a href="${pageContext.request.contextPath }/content/addSocial.action?fs_emp_id=${empId}" style="text-decoration: none;">新增家庭成员及社会关系</a></td>
                                </tr>
                              </tbody>
                            </table>
                          </div>
                      </div>
                  </div>

              </div>

           </div>
           <div class="col-sm-10">
           <!-- 主体内容 -->
           <!-- 职业生涯信息 -->
            <div class="panel panel-success">
              <div class="panel-heading">
                  <h3 class="panel-title">职业生涯信息</h3>
              </div>
              <div class="panel-body">
                    <table class="table table-hover table-bordered">

                        <thead>
                          <tr>
                            <th>起始年月</th>
                            <th>截止年月</th>
                            <th>所在单位名称</th>
                            <th>从事工作内容</th>
                            <th>担任职务</th>
                            <th>年薪/月薪</th>
                            <th>证明人</th>
                            <th>证明人职务</th>
                            <th>证明人电话</th>
                            <th>备注</th>
                            <th>操作</th>
                          </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${CareerInfoList}" var="item">
                           <tr>
                            <td>${item.car_date_s}</td>
                            <td>${item.car_date_e}</td>
                            <td>${item.car_com}</td>
                            <td>${item.car_job}</td>
                            <td>${item.car_business}</td>
                            <td>${item.car_salary_year}/年</td>
                            <td>${item.car_reference}</td>
                            <td>${item.car_ref_business}</td>
                            <td>${item.car_ref_phone}</td>
                            <td>${item.car_remark}</td>
                            <td width="200px">
                            <button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal" onclick="editCareer(${item.car_id})">修改信息</button>
                            <button type="button" class="btn btn-danger" onclick="deleteCareer(${item.car_id})">删除信息</button>
                            </td>
                          </tr>						  
						</c:forEach>
                          
                          
                         

                        </tbody>
                      </table>

              </div>
          </div>
          <!-- 外语能力 -->
          <div class="panel panel-success">
              <div class="panel-heading">
                  <h3 class="panel-title">外语能力</h3>
              </div>
              <div class="panel-body">
                    <table class="table table-hover table-bordered">

                        <thead>
                          <tr>
                            <th>外国语种</th>
                            <th>外国语种熟练程度</th>
                            <th>操作</th>
                          </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${LanguageInfoList}" var="item">
                          <tr>
                            <td>${item.lan_type}</td>
                            <td>${item.lan_level}</td>
                            <td width="200px">
                            <button type="button" class="btn btn-info" data-toggle="modal" data-target="#language" onclick="editLanguage(${item.lan_id})">修改信息</button>
                            <button type="button" class="btn btn-danger" onclick="deleteLanguage(${item.lan_id})">删除信息</button>
                            </td>
                          </tr>
                         </c:forEach>
                         

                        </tbody>
                      </table>

              </div>
          </div>
          <!-- 家庭成员及社会关系信息 -->
          <div class="panel panel-success">
              <div class="panel-heading">
                  <h3 class="panel-title">家庭成员及社会关系信息</h3>
              </div>
              <div class="panel-body">
                    <table class="table table-hover table-bordered">

                        <thead>
                          <tr>
                            <th>与本人关系</th>
                            <th>姓名</th>
                            <th>所在单位</th>
                            <th>职位</th>
                            <th>联系电话</th>
                            <th>操作</th>
                          </tr>
                        </thead>
                        <tbody>
                       <c:forEach items="${SocialInfoList}" var="item"> 
                          <tr>
                            <td>${item.fs_relation}</td>
                            <td>${item.fs_name}</td>
                            <td>${item.fs_com}</td>
                            <td>${item.fs_job}</td>
                            <td>${item.fs_phone}</td>
                            <td width="200px">
                            <button type="button" class="btn btn-info" data-toggle="modal" data-target="#relative" onclick="editSocial(${item.fs_id})">修改信息</button>
                            <button type="button" class="btn btn-danger" onclick="deleteSocial(${item.fs_id})">删除信息</button>
                            </td>
                          </tr>
                       </c:forEach> 
                          



                        </tbody>
                      </table>

              </div>
          </div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">修改信息</h4>
            </div>
            <form class="bs-example bs-example-form" role="form" id="edit_career_form">
            <div class="modal-body">
               <div class="input-group">
                    <span class="input-group-addon">起始年月</span>
                    <input type="date" class="form-control" id="car_date_s" name="car_date_s">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">截止年月</span>
                    <input type="date" class="form-control" id="car_date_e" name="car_date_e">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">单位名称</span>
                    <input type="text" class="form-control" id="car_com" name="car_com">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">工作内容</span>
                    <input type="text" class="form-control"  id="car_job" name="car_job">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">担任职务</span>
                    <input type="text" class="form-control"  id="car_business" name="car_business">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">年薪/月薪</span>
                    <input type="text" class="form-control"  id="car_salary_year" name="car_salary_year">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">证明人</span>
                    <input type="text" class="form-control"  id="car_reference" name="car_reference">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">证明人职务</span>
                    <input type="text" class="form-control"  id="car_ref_business" name="car_ref_business">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">证明人电话</span>
                    <input type="text" class="form-control"  id="car_ref_phone" name="car_ref_phone">
                </div>
                <br>
                <div class="form-group">
                  <label for="name" style="
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #555;
    text-align: center;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;">备注</label>
                  <textarea class="form-control" rows="5"  id="car_remark" name="car_remark">好好好好</textarea>
                </div>
                <br>
                 <input type="hidden" class="form-control"  id="car_id" name="car_id">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" onclick="updateCareer()">提交修改</button>
                <button type="reset" class="btn btn-default" data-dismiss="modal">关闭</button>

            </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="language" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">语言能力</h4>
            </div>
           <form role="form" id="edit_language_form">
            <div class="modal-body">

                <div class="input-group">
                    <span class="input-group-addon">外国语种</span>
                    <select class="form-control" id="lan_type" name="lan_type">
                      <option  value="英语">英语</option>
                      <option  value="法语">法语</option>
                      <option  value="俄语">俄语</option>
                      <option  value="日语">日语</option>
                      <option  value="西班牙">西班牙语</option>
                    </select>
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">熟练程度</span>
                    <select class="form-control"id="lan_level" name="lan_level" >
                      <option value="完全不懂">完全不懂</option>
                      <option value="少量，不能进行业务沟通">少量，不能进行业务沟通</option>
                      <option value="有限的业务沟通">有限的业务沟通</option>
                      <option value="一般，业务沟通仍受少量限制">一般，业务沟通仍受少量限制</option>
                      <option value="好， 无困难地进行谈判和讲演">好， 无困难地进行谈判和讲演</option>
                      <option value="流利，在商务中自如地运用">流利，在商务中自如地运用</option>
                    </select>
                </div>
                <br>
                 <input type="hidden" class="form-control"  id="lan_id" name="lan_id">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="updateLanguage()">提交更改</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
          </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="relative" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">语言能力</h4>
            </div>
           <form role="form" id="edit_social_form">
            <div class="modal-body">

                <div class="input-group">
                    <span class="input-group-addon">与本人关系</span>
                    <select class="form-control" id="fs_relation" name="fs_relation">
                      <option  value="父亲">父亲</option>
                      <option  value="母亲">母亲</option>
                      <option  value="配偶">配偶</option>
                      <option  value="儿子">儿子</option>
                      <option  value="女儿">女儿</option>
                    </select>
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">姓名</span>
                    <input type="text" class="form-control" id="fs_name" name="fs_name">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">所在单位</span>
                    <input type="text" class="form-control" id="fs_com" name="fs_com">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">职位</span>
                    <input type="text" class="form-control" id="fs_job" name="fs_job">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">联系电话</span>
                    <input type="text" class="form-control" id="fs_phone" name="fs_phone">
                </div>
                <br>
                <input type="hidden" class="form-control"  id="fs_id" name="fs_id">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="updateSocial()">提交更改</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
          </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
           <!-- 主体内容 -->

           </div>



           </div>
       </div>
   <!-- </div> -->



<!-- jQuery -->
	<script src="<%=basePath%>js/jquery-3.2.1.min.js"></script>

	<!-- Bootstrap Core JavaScript -->
	<script src="<%=basePath%>js/bootstrap.min.js"></script>
	<script type="text/javascript">
      $(function(){
        document.getElementById("myDate").value = "2014-02-09";
        document.getElementById("myDatet").value = "2018-07-04";
         $("[data-toggle='tooltip']").tooltip();
      });
      
      function editCareer(id) {
			$.ajax({
				type:"get",
				url:"<%=basePath%>content/detail.action",
				data:{"id":id},
				success:function(data) {
					$("#car_date_s").val(data.car_date_s);
					$("#car_date_e").val(data.car_date_e);
					$("#car_com").val(data.car_com)
					$("#car_job").val(data.car_job)
					$("#car_business").val(data.car_business)
					$("#car_salary_year").val(data.car_salary_year);
					$("#car_reference").val(data.car_reference);
					$("#car_ref_business").val(data.car_ref_business);
					$("#car_ref_phone").val(data.car_ref_phone);
					$("#car_remark").val(data.car_remark);
					$("#car_id").val(data.car_id);
					
				}
			});
		}
      function editLanguage(id) {
			$.ajax({
				type:"get",
				url:"<%=basePath%>content/detailLanguage.action",
				data:{"id":id},
				success:function(data) {					
					$("#lan_type").val(data.lan_type);
					$("#lan_level").val(data.lan_level);
					$("#lan_id").val(data.lan_id);
				}
			});
		}
      function editSocial(id) {
			$.ajax({
				type:"get",
				url:"<%=basePath%>content/detailSocial.action",
				data:{"id":id},
				success:function(data) {
					$("#fs_id").val(data.fs_id);
					$("#fs_relation").val(data.fs_relation);
					$("#fs_name").val(data.fs_name);
					$("#fs_com").val(data.fs_com);
					$("#fs_job").val(data.fs_job);
					$("#fs_phone").val(data.fs_phone);
					
				}
			});
		}
      
		function updateCareer() {
			$.post("<%=basePath%>content/update.action",$("#edit_career_form").serialize(),function(data){
				alert("客户职业生涯信息更新成功！");
				window.location.reload();
			});
		}
		
		function updateLanguage() {
			$.post("<%=basePath%>content/updateLanguage.action",$("#edit_language_form").serialize(),function(data){
				alert("客户语言信息更新成功！");
				window.location.reload();
			});
		}
		
		function updateSocial() {
			$.post("<%=basePath%>content/updateSocial.action",$("#edit_social_form").serialize(),function(data){
				alert("社会关系信息更新成功！");
				window.location.reload();
			});
		}
		
		
		
		
		
		function deleteCareer(id) {
			if(confirm('确实要删除该职业生涯信息吗?')) {
				$.post("<%=basePath%>content/delete.action",{"id":id},function(data){
					alert("职业生涯信息删除成功！");
					window.location.reload();
				});
			}
		}
		
		function deleteLanguage(id) {
			if(confirm('确实要删除该语言信息吗?')) {
				$.post("<%=basePath%>content/deleteLanguage.action",{"id":id},function(data){
					alert("语言信息删除成功！");
					window.location.reload();
				});
			}
		}
		function deleteSocial(id) {
			if(confirm('确实要删除该社会关系信息吗?')) {
				$.post("<%=basePath%>content/deleteSocial.action",{"id":id},function(data){
					alert("社会关系信息删除成功！");
					window.location.reload();
				});
			}
		}
    </script>
</body>
</html>